import cn.picclife.mwx.common.core.util.JsonUtils;
import cn.picclife.mwx.manager.sys.controller.CollectDataController;
import cn.picclife.mwx.manager.sys.model.bo.DecrySaveReq;
import cn.picclife.mwx.manager.sys.model.bo.UpdateCollectReq;
import cn.picclife.mwx.manager.sys.service.impl.CollectDataServiceImpl;
import cn.picclife.mwx.manager.util.CompressUtil;
import cn.picclife.mwx.manager.util.FileUtil;
import cn.picclife.mwx.manager.util.Md5Util1;
import org.apache.commons.logging.Log;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.core.ZSetOperations;

import java.io.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.jar.JarFile;

public class MyTest {
    public static void main(String[] args) throws IOException {
        /*try{
            File file=new File("C:\\Users\\Administrator\\Desktop\\联调准备的大体清单.txt");
            InputStream inputStream = new FileInputStream(file);
            InputStreamReader read = new InputStreamReader((inputStream),"UTF-8");
            BufferedReader bufferedReader = new BufferedReader(read);
            String readerStr = null;
            String buffer = "";
            while((readerStr = bufferedReader.readLine()) != null){
                buffer = buffer + readerStr;
            }
            read.close();
            System.out.println("解析TXT内容的内容是"+ buffer);
        }catch(Exception e){

        }*/
       /* String fileDirsinglezip="D:/zip/";
        String fileName="20210728_12123123.zip";

        String zipsecret=fileName.substring(0,fileName.indexOf(".zip"));
        System.out.println("SingleZip加密前"+zipsecret + "123456");
        String md5 = Md5Util1.getMd5(zipsecret + "123456");
        System.out.println(md5);
        CompressUtil.unZip(fileDirsinglezip+fileName,fileDirsinglezip,md5);*/
     /*  StringBuffer s =new StringBuffer();
        String s1 = s.toString();
        String[] split = s1.split("1");
        System.out.println(split.length);*/
        /*DecrySaveReq decrySaveReq = JsonUtils.json2Obj("", DecrySaveReq.class);

        System.out.println(decrySaveReq);*/
       /* List<File> list=new ArrayList<>();
        FileUtil.findFileZipList(new File("C:\\Users\\Administrator\\Desktop\\orcl"),list);
        for (File file : list) {
            System.out.println("==========================================="+file.getName());
        }*/


        File file1=new File("D:/zip/");
        List<File> fileList=new ArrayList<>();
      FileUtil.findFileZipList(file1,fileList);
        for (File file : fileList) {
            System.out.println(file.getName());
        }




    }

    public static String getTxtContent(String buffer, File txtFile) throws IOException {

        InputStream inputStream = new FileInputStream(txtFile);
        InputStreamReader read = new InputStreamReader((inputStream),"UTF-8");
        BufferedReader bufferedReader = new BufferedReader(read);
        String readerStr = null;
        while((readerStr = bufferedReader.readLine()) != null){
            buffer = buffer + readerStr;
        }
        read.close();
        System.out.println("解析TXT内容的内容是"+ buffer);
        return buffer;
    }
}
